<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});


// 创建路由组
Route::group(['middleware'=>'log'],function(){
//后台文件管理
Route::Controller('/admin/file','FileController');
// 隐式路由器 管理前台用户
Route::Controller('/admin/member','AdminsController');
//后台控制器
Route::Controller('/admin/','AdminController');
//后台用户控制器
Route::Controller('/admin/user','UserController');
//后台分类
Route::Controller('/admin/sort','SortController');
//后台商品
Route::Controller('/admin/goods','GoodsController');

 //后台商品分类
Route::Controller('/admin/sort','SortController');
//后台订单管理
Route::Controller('/admin/orders','OrdersController');

// 后台链接管理
Route::Controller('/admin/link','LinkController');
// 后台轮播管理
Route::Controller('/admin/play','PlayController');
//后台用户退出
Route::get('/tuichu','LoginController@tuichu');
//后台咨询管理
Route::controller('/admin/article','ArticleController');
// 后台评论页
Route::Controller('/comment','CommentController');
});
// 隐式路由器 后台登录
Route::Controller('/admin/log','LoginController');


// 404页面
Route::get('/404', function(){
    abort(404);
});
// 前台购物车
Route::Controller('/admin/goods','GoodsController');

//前台首页
Route::get('/','IndexController@index');

//头部搜索
Route::match(['get','post'],'/search','IndexController@search');
//商品列表页
Route::Controller('/goods','GoodsController');


//前台咨询管理
Route::controller('/sought','SoughtController');

// 隐式路由器 前台登录
Route::Controller('/log/log','LoginController');
//前台用户退出
Route::get('/logout','LoginController@logout');

// 隐式路由器 详情页面
Route::Controller('/xiangqing/xiangqing','XqController');

// 加入购物车
Route::match(['get','post'],'/cart/insert','CartController@insert');
// 查看购物车
Route::get('/cart/index','CartController@index');
//删除购物车中的商品
Route::get('/cart/delete','CartController@delete');
// 清空购物车
Route::get('/cart/clear','CartController@clear');
//下单操作
Route::match(['get','post'],'/order/insert','OrderController@insert');
//支付订单
Route::get('/cart/zhifu','OrderController@zhifu');
Route::post('/cart/zhifule','OrderController@zhifule');


//前台下载文件
Route::Controller('/asd','AsdController');


// 注册
Route::get('register','LoginController@register');
Route::post('register','LoginController@doregister');
//邮件注册
Route::get('mail','LoginController@sendMail'); 
// 激活
Route::get('jihuo','LoginController@jihuo');
//忘记密码
Route::get('forget','LoginController@getForget');
Route::post('forget','LoginController@doforget');
// 重置密码路由 记得原密码
Route::get('replaces','LoginController@replaces');
Route::post('/mima/huan','MimaController@huan');
//重置密码
Route::get('reset','LoginController@reset');
Route::post('reset','LoginController@doReset');
//显示收藏页面
Route::get('collect','CollectController@getCollect');
//点击收藏
Route::get('sc','CollectController@getSc');
//取消收藏
Route::Controller('del','CollectController');
//个人中心页
Route::Controller('/list','ListController');
